import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
    {
        path: "/",
        name: "Main",
        component: () => import("../views/Main.vue"),
        children: [
            {
                path: "shelf",

                name: "Shelf",
                component: () => import("../views/ShelfView.vue"),
            },
            {
                path: "bookstore",
                name: "Bookstore",
                alias: "",
                component: () => import("../views/BookstoreView.vue"),
            },
            {
                path: "sort",
                name: "Sort",
                component: () => import("../views/SortView.vue"),
            },
            {
                path: "video",
                name: "Video",
                component: () => import("../views/VideoView.vue"),
            },
            {
                path: "my",
                name: "My",
                component: () => import("../views/MyView.vue"),
            },
        ],
    },
    {
        path: "/bookcontent",
        name: "BookContent",
        component: () => import("../views/BookContentView.vue"),
    },
    {
        path: "/bookdetails",
        name: "BookDetails",
        component: () => import("../views/BookDetailsView.vue"),
    },
    {
        path: "/login",
        name: "Login",
        component: () => import("../views/LoginView.vue"),
    },
    {
        path: "/set",
        name: "Set",
        component: () => import("../views/SetView.vue"),
    },
    {
        path: "/search",
        name: "Search",
        component: () => import("../views/SearchView.vue"),
    },
    {
        path: "/allcomment",
        name: "Allcomment",
        component: () => import("../views/AllCommentView.vue"),
    },
    {
        path: "/catalogue",
        name: "Catalogue",
        component: () => import("../views/CatalogueView.vue"),
    },
    {
        path: "/topclassify",
        name: "TopClassify",
        component: () => import("../views/TopClassifyView.vue"),
    },
    {
        path: "/listenBook",
        name: "ListenBook",
        component: () => import("../views/ListenBookView.vue"),
    },
    {
        path: "/bookList",
        name: "BookList",
        component: () => import("../views/BookListView.vue"),
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    // }
];

const router = new VueRouter({
    routes,
});

export default router;
